﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;

namespace InkFx.WinControl
{
    public class Form : System.Windows.Forms.Form
    {
        private static int m_IsDesignMode = -1;
        /// <summary>
        /// 当前环境是否是 设计时 (控件在VS中初始化)
        /// </summary>
        public static bool IsDesignMode
        {
            get
            {
                if (m_IsDesignMode == -1)
                {
                    if (LicenseManager.UsageMode == LicenseUsageMode.Designtime) m_IsDesignMode = 1;
                    else if (Process.GetCurrentProcess().ProcessName.ToUpper().Equals("DEVENV")) m_IsDesignMode = 1;
                    else m_IsDesignMode = 0;
                }
                return m_IsDesignMode == 1;
            }
        }

    }
}
